package org.go.scheduler.database;

import java.util.Date;

import org.go.trigger.TriggerKey;
import org.go.work.WorkKey;

/**
 * <p>
 * Object representing a job or trigger key.
 * </p>
 * 
 * @author James House
 */
public class TriggerStatus {

	private WorkKey jobKey;

	private TriggerKey key;

	private Date nextFireTime;

	private String status;

	/**
	 * Construct a new TriggerStatus with the status name and nextFireTime.
	 * 
	 * @param status
	 *          the trigger's status
	 * @param nextFireTime
	 *          the next time the trigger will fire
	 */
	public TriggerStatus(String status, Date nextFireTime) {
		this.status = status;
		this.nextFireTime = nextFireTime;
	}

	public WorkKey getJobKey() {
		return jobKey;
	}

	public TriggerKey getKey() {
		return key;
	}

	/**
	 * <p>
	 * Get the group portion of the key.
	 * </p>
	 * 
	 * @return the group
	 */
	public Date getNextFireTime() {
		return nextFireTime;
	}

	/**
	 * <p>
	 * Get the name portion of the key.
	 * </p>
	 * 
	 * @return the name
	 */
	public String getStatus() {
		return status;
	}

	public void setJobKey(WorkKey jobKey) {
		this.jobKey = jobKey;
	}

	public void setKey(TriggerKey key) {
		this.key = key;
	}

	/**
	 * <p>
	 * Return the string representation of the TriggerStatus.
	 * </p>
	 *  
	 */
	@Override
	public String toString() {
		return "status: " + getStatus() + ", next Fire = " + getNextFireTime();
	}
}
